package com.luyuan.crm.question.model;

public enum QuestionField {
    TEXT(1, "文本"), RADIO(2, "单选"), TEXTAREA(3, "文本"), BIGTEXTAREA(4, "大文本");
    private int value;

    private String name;

    private QuestionField(int index, String name) {
        this.value = index;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public QuestionField valueOf(int index) {
        QuestionField questionFieldType = null;
        switch (index) {
        case 1:
            questionFieldType = QuestionField.TEXT;
            break;
        case 2:
            questionFieldType = QuestionField.RADIO;
            break;
        case 3:
            questionFieldType = QuestionField.TEXTAREA;
            break;

        default:
            questionFieldType = QuestionField.TEXT;
            break;
        }
        return questionFieldType;
    }
}
